<template>
    <button class="button"
        @click = "onClick"
        >
<!--        @click = "$emit('click',$event)"-->
        <slot></slot>
    </button>
</template>

<script>
    import Vue from 'vue'
    import {Component} from 'vue-property-decorator'

    @Component
    export default class Button extends Vue {
        onClick(event){
            this.$emit('click',event)
            // console.log('这是b组件的值',event)
        }
    }
</script>

<style lang="scss" scoped>
    .button {
        background: #767676;
        color: white;
        border-radius: 4px;
        border: none;
        height: 40px;
        padding: 0 16px;
        &-wrapper {
            text-align: center;
            padding: 16px;
            margin-top: 44-16px;
        }
    }
</style>